package ai.rpc.consumer;

import ai.rpc.common.model.User;
import ai.rpc.core.proxy.ServiceProxyFactory;
import ai.rpc.common.service.UserService;
/**
 * @Author: mengyu
 * @Date: 2024/7/14
 */
public class EasyConsumerExample {
    public static void main(String[] args) {
        // 获取代理类
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        // 调用
        User user = userService.getUserById(1L);
        if(user != null){
            System.out.println(user.getName());
        }else {
            System.out.println("user == null");
        }
        int number = userService.getNumber();
        System.out.println(number);
    }
}
